<?php

//$urlbase = "http://193.10.57.199:8080/simpleWS/";
$urlbase = 'http://localhost:8080/simpleWS/';
$url = $urlbase . $_GET['url'];
$q = urlencode($_GET['q']);
$limit = $_GET['limit'];
$timestamp = $_GET['timestamp'];
$url = "$url?q=$q&limit=$limit&timestamp=$timestamp"; 

//echo $url;

require_once "pear/HTTP/Request.php";

$req =& new HTTP_Request($url);
$req->setMethod(HTTP_REQUEST_METHOD_GET);
if (!PEAR::isError($req->sendRequest())) {
     $res = $req->getResponseBody();
} else {
     $res = "";
}
echo $res;

//$file = fopen($url, 'r');
//$content = fread($file, 100000000 );
//fclose($file);
//echo $content;

?>
